# $Id$
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=libaccounts-qt
pkgdesc="Qt-based client library for accessing the online accounts database"
pkgver=1.15
pkgrel=1
arch=(i686 x86_64)
url="https://gitlab.com/accounts-sso/libaccounts-qt"
license=(LGPL)
depends=(libaccounts-glib qt5-base)
makedepends=(doxygen)
conflicts=(libaccounts-qt5)
provides=(libaccounts-qt5)
replaces=(libaccounts-qt5)
source=("https://gitlab.com/accounts-sso/libaccounts-qt/repository/archive.tar.bz2?ref=VERSION_$pkgver")
sha1sums=('eaed098ecb8241fb094e8b43fde769fdf059031f')

prepare() {
  mv $pkgname-VERSION_$pkgver-* $pkgname-$pkgver

  cd $pkgname-$pkgver
  sed -i 's|SUBDIRS  += Accounts tests|SUBDIRS += Accounts|' accounts-qt.pro
  cd ..
}

build() {
  cd $pkgname-$pkgver
  qmake PREFIX=/usr LIBDIR=/usr/lib
  make
}

package() {
  cd $pkgname-$pkgver
  make INSTALL_ROOT="$pkgdir" install

# Remove docs
  rm -r "$pkgdir"/usr/share
}
